const webpack = require('webpack');
const { merge } = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const baseWebpackConfig = require('./webpack.common');

module.exports = merge(baseWebpackConfig, {
  mode: 'development',
  devtool: 'cheap-eval-module-source-map',
  devServer: {
    open: true,
    hot: true,
  },
  plugins: [
    new HtmlWebpackPlugin({
      title: 'vue-app-base',
      url: '',
      filename: 'index.html',
      template: 'public/index.html',
      inject: true,
    }),
    new webpack.HotModuleReplacementPlugin(),
  ],
});
